<?php

namespace App\Http\Controllers;

use App\Traits\ApiResponse;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Support\Facades\Auth;

class Controller extends BaseController
{
    use AuthorizesRequests, DispatchesJobs, ValidatesRequests, ApiResponse;

    public $view_dir = 'app';

    public function __construct()
    {
        $is_alert_notice = 1;
        if (Auth::guard()->check()) {
            $user = Auth::user();
            $is_alert_notice = $user->is_alert_notice ? 1 : 0;
        }
        view()->share('is_alert_notice', $is_alert_notice);
    }
}
